package com.lzp.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AuthorController {
    @Autowired
    private AuthService authService;
    @GetMapping("/author")
    public R authUser(String username,String password){//生成token,并将token返回给前端
        String token = authService.auth(username, password);
        return R.ok().put("token",token);
    }
}
